<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>找回密码-蚂蚁街</title>
<link href="__APP__/statics/css/style.css" rel="stylesheet" type="text/css"  charset="utf-8"/>
<style>
a{text-decoration:none}
img{border:0px}
.login{padding:10px;width:850px;border:1px solid #dddddd;margin:0 auto;margin-top:50px;}
.guocheng{text-align:center;border-bottom:1px solid #dddddd}
input{padding:5px}
</style>

</head>
<body>

<div class="top" style="width:850px;margin:0 auto;margin-top:20px;">
<a href="__APP__"><img src="__APP__/statics/logo-201305.png"></a>
</div>
<div class="login">
<switch name="action" >
<case value="second">
<div class="guocheng"><img src="__APP__/statics/getpwd2.jpg"></div>
<div style="width:360px;height:100px;margin:0 auto;margin-top:30px;">
	<div style="width:50px;float:left;"><img src="__APP__/statics/infosuccess.gif"></div>
	<div style="text-align:center;line-height:30px;width:270px;float:right">邮件发送成功！请在2小时内完成操作<br>立即<a href="{$elink}" target="_blank">登录邮箱</a>验证</div>
</div>
</case>
<case value="third">
<div class="guocheng"><img src="__APP__/statics/getpwd3.jpg"></div>
<if condition="$isvolid eq '1'">
<div style="margin-top:30px;">
<table border="0" width="100%" id="table1" height="99">
	<tr>
		<td align="right">新密码：</td>
		<td><input type="password" name="pwd" size="20"></td>
	</tr>
	<tr>
		<td align="right">确认密码：</td>
		<td><input type="password" name="repwd" size="20"></td>
	</tr>
	<tr height="80">
		<td colspan="2" align="center"><a href="javascript:setpwd();"><img src="__APP__/statics/repwd.jpg"></td>
	</tr>
</table>
<input type="text" id="token" value="{$token}" style="display:none">
</div>
<else/>
<div style="width:360px;height:100px;margin:0 auto;margin-top:50px;">
	<div style="width:50px;float:left;"><img src="__APP__/statics/infoerror.gif"></div>
	<div style="text-align:center;line-height:30px;width:300px;float:right">验证异常！链接可能已失效，请重新操作<br><a href="__APP__/Public/get_password">重新验证</a></div>
</div>
</if>
</case>
<default />
<div class="guocheng"><img src="__APP__/statics/getpwd1.jpg"></div>
<div style="margin-top:30px;">
<table border="0" width="100%" id="table1" height="99">
	<tr>
		<td align="right">账户邮箱：</td>
		<td><input type="text" name="email" size="20"></td>
	</tr>
	<tr>
		<td align="right">验证码：</td>
		<td><input type="text" name="yzm" size="6">&nbsp;&nbsp;<img id="verifyImg" src="__URL__/verify" height="25px" onclick="fleshVerify()"><a href="javascript:fleshVerify();"><span style="font-size:13px;color:#666666">看不清？</span></a></td>
	</tr>
	<tr height="80">
		<td colspan="2" align="center"><a href="javascript:yzUser();"><img src="__APP__/statics/yzpwd.jpg"></a></td>
	</tr>
</table>
</div>
</switch>
</div>

<script src="__APP__/statics/jquery.1.4.2.js"></script>
<link rel="stylesheet" type="text/css" href="__APP__/statics/css/jNotify.jquery.css" />
<script type="text/javascript" src="__APP__/statics/jNotify.jquery.js"></script>

<script>
function fleshVerify(){
		var timenow = new Date().getTime();
		document.getElementById('verifyImg').src='__GROUP__/Public/verify/'+timenow;  
}

function yzUser(){
        var email=$("[name=email]").val();
		var yzm=$("[name=yzm]").val();
        $.ajax({
			type:"POST",
			url:"__URL__/yzuser/",
			dataType:"html",
			data:{email:email,yzm:yzm},
			success:function(data){
				if(data==1){
					jError("<strong>无此用户，请检查email！</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
				   $("[name=email]").focus();
				}else if(data==2){
				    jError("<strong>验证码不正确！</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
				   $("[name=yzm]").focus();
				   $("[name=yzm]").val('');
				}else{
				   jSuccess("<strong>邮件发送成功！</strong>",{TimeShown : 2000,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){window.location.href="__URL__/get_password/?action=second&email="+data;}})
				}
			}
		   })
}

function setpwd(){
    var token=$("#token").val();
	var pwd=$("[name=pwd]").val();
	var repwd=$("[name=repwd]").val();
	if(pwd!=repwd){
	      jError("<strong>密码输入不一致！请重新输入</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
		  $("[name=pwd]").val('');
		  $("[name=repwd]").val('');
	}else{
	      $.ajax({
		        type:"POST",
				url:"__URL__/setpwd",
				dataType:"json",
				data:{'token':token,'pwd':pwd},
				success:function(data){
				    if(data==1){
					   jSuccess("<strong>密码修改成功！</strong>",{TimeShown : 2000,VerticalPosition : 'center',HorizontalPosition : 'center',onClosed:function(){window.location.href="__GROUP__/Member/login";}})
					}else{
					   jError("<strong>修改失败！请重试</strong>",{VerticalPosition : 'center',HorizontalPosition : 'center'});
					}
				}
		  })
	}
}
</script>
</body>
</html>